<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%> 

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>分销商展示</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="js/jquery-1.8.2.min.js"></script>
</head>
<body style="background:url(img/top.jpg) repeat-x;" height="100%" >
	<div class="rightinfo">
		<div class="tools">
			<ul class="toolbar">
				<%-- <c:hidden id="pid" name="pid"/> --%>
				<c:if test="${sessionScope.distributor.distributor_id != parent.distributor_id }">
						<li><a href="<%=request.getContextPath()%>/distributor/distributorList.action">
							<span>
								<img src="img/pre.gif" style="margin-top:6px;" />
							</span>
							返回上一级</a>
					</li>
				</c:if>
				<li><a href="<%=request.getContextPath()%>/distributor/addDistributorUI.action">
						<span><img
							src="img/t01.png" />
						</span>添加</a></li>
				<li class="click" value="#"><span><img
						src="img/t04.png" />
				</span>排序(保留)</a></li>
			</ul>
		</div>
		<table class="tablelist">
			<thead>
				<tr>
					<th><input name="" type="checkbox" value="" checked="checked" />
					</th>
					<th>类型<i class="sort"><img
							src="img/px.gif" />
					</i>
					</th>
					<th>姓名</th>
					<th>身份证号码</th>
					<th>电话</th>
					<th>账号状态</th>
					<th>隶属关系</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody id="tbody">
				<c:forEach items="${resultList}" var="item">
					<tr>
						<td><input name="" type="checkbox" value="" />
						</td>
						<td>${item.distributor_type}</td>
						<td>${item.distributor_name}</td>
						<td>${item.distributor_account}</td>
						<td>${item.distributor_tel}</td>
						<td>${item.distributor_status}</td>
						<td>${item.distributor_pid}</td>
						<td>
							<a href="<%=request.getContextPath()%>/distributor/editDistributorUI.action?id=${item.distributor_id}" cssClass="tablelink">修改&nbsp;|&nbsp;</a>
							<a href="<%=request.getContextPath()%>/distributor/deleteById.action?id=${item.distributor_id}" cssClass="tablelink">删除&nbsp;|&nbsp;</a>
							<a href="<%=request.getContextPath()%>/distribute_setPrilegeUI?id=%{id}" cssClass="tablelink">设置权限&nbsp;|&nbsp;</a> 
							<a href="<%=request.getContextPath()%>/distributor/distributorList.action?pid=${item.distributor_id }" cssClass="tablelink">查看子分销商</a>
						</td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
		<div class="pagin">
			<div class="message">
				共<i class="blue">${pageBean.recordCount}</i>条记录,
				当前显示第&nbsp;<i class="blue">${pageBean.currentPage}/${pageBean.pageCount}&nbsp;</i>页,
				每页显示&nbsp;<i class="blue">${pageBean.pageSize}&nbsp;</i>条
			</div>
			<ul class="paginList">
				<li class="paginItem">
					
					<c:choose>
						<c:when test="${pageBean.currentPage > 1 }"> 
						   		 <a href="<%=request.getContextPath()%>/distributor/distributorList.action?pid=${parent.distributor_id}&pageNum=${pageBean.currentPage-1}"></a>
									<span class="pagepre"></span> 
						   </c:when>
						   
						   <c:otherwise>
						   		 <a href=""></a>
								 <span class="pagepre"></span>
						   </c:otherwise>
						  
						</c:choose>
					
					</li>
				<c:forEach var="i" begin="${pageBean.beginPageIndex}" end="${pageBean.endPageIndex}">
					<c:choose>
						   <c:when test="${pageBean.currentPage ==i }"> 
						   		 <li class="paginItem current"><a href="javascript:;">${i}</a>
						   </c:when>
						   <c:otherwise>
						   		 <li class="paginItem">
						   		 <a href="<%=request.getContextPath()%>/distributor/distributorList.action?pid=${parent.distributor_id}&pageNum=${i}">${i}</a>
						   </c:otherwise>
						</c:choose>
				</c:forEach>
				<li class="paginItem">
				
					<c:choose>
						<c:when test="${pageBean.currentPage != pageBean.pageCount }"> 
						   		 <a href="<%=request.getContextPath()%>/distributor/distributorList.action?pid=${parent.distributor_id}&pageNum=${pageBean.currentPage+1}"></a>
									<span class="pagenxt"></span>
						   </c:when>
						   
						   <c:otherwise>
						   		 <a href=""></a>
								 <span class="pagenxt"></span>
						   </c:otherwise>
						  
						</c:choose>
					
					
				</li>
			</ul>
		</div>
	</div>
</body>
</html>
